<!doctype html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>个人信息</title>
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <link href="../../../css/mui.min.css" rel="stylesheet" />
        <style>
            .mui-table-view span.mui-pull-right {
                color: #999;
                margin-right: 26px;
            }
            .mui-ellipsis {
                width: 200px;
                text-align: right;
            }
        </style>
    </head>
    <body>
        <header class="mui-navbar-inner mui-bar mui-bar-nav">
            <button type="button" class="mui-left mui-action-back mui-btn  mui-btn-link mui-btn-nav mui-pull-left">
                <span class="mui-icon mui-icon-left-nav"></span>
            </button>
            <h1 class="mui-center mui-title">个人信息</h1>
        </header>
        <div class="mui-content">
            <ul class="mui-table-view" id="content">
                <li class="mui-table-view-cell">
                    <a>
                        姓名
                        <span class="mui-pull-right"></span>
                    </a>
                </li>
                <li class="mui-table-view-cell" id="job">
                    <a>
                        职称
                        <span class="mui-pull-right"></span>
                    </a>
                </li>
                <li class="mui-table-view-cell">
                    <a>
                        所在医院
                        <span class="mui-pull-right"></span>
                    </a>
                </li>
                <li class="mui-table-view-cell">
                    <a>
                        科室
                        <span class="mui-pull-right"></span>
                    </a>
                </li>
                <li class="mui-table-view-cell" id="goodAt">
                    <a class="mui-navigate-right">
                        擅长
                        <span class="mui-pull-right"></span>
                    </a>
                </li>
                <li class="mui-table-view-cell" id="intro">
                    <a class="mui-navigate-right">
                        医生简介
                        <span class="mui-pull-right mui-ellipsis" style="width: 200px;"></span>
                    </a>
                </li>
            </ul>
        </div>
        <script src="../../../js/mui.min.js"></script>
        <script src="../../../js/userInfo.js"></script>
        <script src="../../../js/tool.js"></script>
        <script src="../../../js/template.js"></script>
        <script id="userInfoTpl" type="text/html">
            <li class="mui-table-view-cell">
                <a>
                    姓名
                    <span class="mui-pull-right mui-ellipsis">{{user.userName}}</span>
                </a>
            </li>
            <li class="mui-table-view-cell" id="job">
                <a>
                    职称
                    <span class="mui-pull-right mui-ellipsis">{{regdoctor.job}}</span>
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a>
                    所在医院
                    <span class="mui-pull-right mui-ellipsis">{{regdoctor.hospitalName}}</span>
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a>
                    科室
                    <span class="mui-pull-right mui-ellipsis">{{regdoctor.divisionName}}</span>
                </a>
            </li>
            <li class="mui-table-view-cell" id="goodAt">
                <a class="mui-navigate-right">
                    擅长
                    <span class="mui-pull-right mui-ellipsis">{{regdoctor.goodAt | goodAtFormat}}</span>
                </a>
            </li>
            <li class="mui-table-view-cell" id="intro">
                <a class="mui-navigate-right">
                    医生简介
                    <span class="mui-pull-right mui-ellipsis">{{regdoctor.attending}}</span>
                </a>
            </li>
        </script>
        <script type="text/javascript">
            var $ = mui, doc = document;
            $.plusReady(function() {
                this.initUserInfo();
                // 编辑完，返回更新详情
                window.addEventListener('refreshInfo',function(){
                    user.refresh();
                    initUserInfo();
                });
            });
            // 初始化用户信息
            function initUserInfo() {
                template.helper('goodAtFormat', function(inp) {
                    if (inp) {
                        return inp.replace(/#/g, '，')
                    }
                });
                var outHtml = template('userInfoTpl', userInfo);
                $("#content")[0].innerHTML = outHtml;

                // 链接
                tool.openWindow('goodAt', 'goodAt.html');
                tool.openWindow('intro', 'intro.html');
            }
        </script>
    </body>
</html>